open(FH,"</Users/yaping/Documents/workspace/result/SNP/1/normal_SNP.filterCNV.filterSeqDepth.30-20-10-1-0.1.txt");
my @normal_all=<FH>;
chomp(@normal_all);
close(FH);
open(FH,"</Users/yaping/Documents/workspace/result/SNP/1/normal_SNP.filterCNV.filterSeqDepth.falseSnp.30-20-10-1-0.1.txt");
my @normal_false=<FH>;
chomp(@normal_false);
close(FH);
my @ag_all;
my @ag_fn;
my @other_all;
my @other_fn;
foreach my $line(@normal_all){
	my @splitin=split "\t",$line;
	if($splitin[3] eq "A" && $splitin[4] eq "B"){
		if(($splitin[5] eq "A" && $splitin[6] eq "G") || ($splitin[5] eq "T" && $splitin[6] eq "C")){
			if($splitin[7]=~/\w[A|G]\w/){
				push(@ag_all,"$splitin[9]\t$splitin[11]\n");
			}
			else{
				push(@ag_all,"$splitin[11]\t$splitin[9]\n");
			}
		}
		else{
			push(@other_all,"$splitin[9]\t$splitin[11]\n");
		}
	}
}
foreach my $line(@normal_false){
	my @splitin=split "\t",$line;
	if($splitin[3] eq "A" && $splitin[4] eq "B"){
		if(($splitin[5] eq "A" && $splitin[6] eq "G") || ($splitin[5] eq "T" && $splitin[6] eq "C")){
			if($splitin[7]=~/\w[A|G]\w/){
				push(@ag_fn,"$splitin[9]\t$splitin[11]\n");
			}
			else{
				push(@ag_fn,"$splitin[11]\t$splitin[9]\n");
			}
		}
		else{
			push(@other_fn,"$splitin[9]\t$splitin[11]\n");
		}
	}
}

open(OUT,">/Users/yaping/Documents/workspace/result/SNP/1/AG_AllSNP.txt");
print OUT @ag_all;
close(OUT);
open(OUT,">/Users/yaping/Documents/workspace/result/SNP/1/other_AllSNP.txt");
print OUT @other_all;
close(OUT);
open(OUT,">/Users/yaping/Documents/workspace/result/SNP/1/AG_FnSNP.txt");
print OUT @ag_fn;
close(OUT);
open(OUT,">/Users/yaping/Documents/workspace/result/SNP/1/other_FnSNP.txt");
print OUT @other_fn;
close(OUT);

